package com.oa.controller.user;

import cn.hutool.json.JSON;
import com.oa.service.user.AttendanceCountService;
import com.oa.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/user")
@CrossOrigin
public class AttendanceCountController {
    @Autowired
    private AttendanceCountService attendanceCountService;
    @GetMapping("/generateAttdanceByday/{day}")
    public SysResult generateAttdanceByday(@PathVariable String day) {
        return SysResult.success(attendanceCountService.generateAttdanceByday(day));
    }
    @GetMapping("/generateAttdanceByUser/{empId}")
    public SysResult generateAttdanceByday1(@PathVariable Integer empId) {
        return SysResult.success(attendanceCountService.generateAttdanceByUser(empId));
    }
    @GetMapping("/getAttendCountListByUser/{empId}")
    public SysResult getAttendCountListByUser(@PathVariable Integer empId){
        return SysResult.success(attendanceCountService.getAttendCountListByUser(empId));
    }
    @GetMapping("/getStackedLineData/{date}")
    public SysResult getStackedLineData(@PathVariable String date) {
        return SysResult.success(attendanceCountService.getStackedLineData(date));
    }

}
